package com.matt.domain;

import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.util.Date;


/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2017/7/13
 * *******************************
 */
@Entity
@Data
@Table(name = "children_extend_info")
@NoArgsConstructor
public class ChildrenExtendInfo {

    @Id
    @Column(columnDefinition = "varchar(32) COMMENT 'id' ")
    private String id;

    @Column(columnDefinition = "varchar(50) COMMENT '宝宝名称 （冗余）' ")
    private String childrenName;

    @Column(columnDefinition = "int COMMENT '签到状态 0，缺席（未签到），1，入园，2，离园，3，拒绝入园 ,4-请假' default 0")
    private Integer checkStatus = 0;

    @Column(columnDefinition = "int COMMENT '健康状态 0，健康，1，不健康' default 0")
    private Integer healthyStatus = 0;

    @Column(columnDefinition = "varchar(50) COMMENT '疾病名称' ")
    private String sickName;

    @Column(columnDefinition = "datetime COMMENT '打卡时间' ")
    private Date checkTime;

    @Column(columnDefinition = "int default -1 COMMENT '托班是否可用， -1：没有托班课程, 0:所有托班课程结束， 1 至少一个托班合同未结束' ")
    private Integer nurseryStatus = -1;

    @Column(columnDefinition = "datetime default NOW() COMMENT '托班合同结束日期'")
    private Date nurseryEndDate = new Date();

    @Column(columnDefinition = "int default -1 COMMENT '早教总课时' ")
    private Integer earlyTotalCourseNum = -1;

    @Column(columnDefinition = "int default -1 COMMENT '早教剩余课时， -1：没有早教课程, 0:早教课时结束， >0 早教剩余次数' ")
    private Integer earlyLeftCourseNum = -1;

    @Column(columnDefinition = "datetime default null COMMENT '摄像头权限有效时间' ")
    private Date cameraValidTo;

//    @Column(columnDefinition = "int default 0 COMMENT '是否绑定课前评测' ")
//    private Integer evaluatingCBBindStatus = 0;

    @Column(name = "childrenId", columnDefinition = "varchar(32) COMMENT '宝宝id' ")
    private String childrenId;

    @Column(columnDefinition = "varchar(500) COMMENT '考勤备注' ")
    private String remark;

    @Column(columnDefinition = "int default 10 COMMENT  '剩余可请假延长合同天数' ")
    private Integer surplusLeaveDay;

    public static ChildrenExtendInfo of(String childrenId, String childrenName){
        ChildrenExtendInfo info = new ChildrenExtendInfo();
        info.setId(childrenId);
        info.setChildrenId(childrenId);
        info.setChildrenName(childrenName);
        return info;
    }
}
